package com.houhanzhi.service;


import com.houhanzhi.controller.request.ShortLinkAddRequest;
import com.houhanzhi.controller.request.ShortLinkDelRequest;
import com.houhanzhi.controller.request.ShortLinkPageRequest;
import com.houhanzhi.controller.request.ShortLinkUpdateRequest;
import com.houhanzhi.model.EventMessage;
import com.houhanzhi.response.JsonData;
import com.houhanzhi.vo.ShortLinkVO;

import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author houhanzhi
 * @since 2025-02-26
 */
public interface ShortLinkService {


    /**
     * 解析短链
     * @param shortLinkCode
     * @return
     */
    ShortLinkVO parseShortLinkCode(String shortLinkCode);

    /**
     * 生产者：创建短链
     *
     * @param request
     * @return
     */
    JsonData createShortLink(ShortLinkAddRequest request);

    /**
     * 处理新增短链消息
     * @param eventMessage
     * @return
     */
    boolean handlerAddShortLink(EventMessage eventMessage);

    /**
     * B端：分页查找短链
     * @param request
     * @return
     */
    Map<String, Object> pageByGroupId(ShortLinkPageRequest request);

    /**
     * 生产者：删除短链
     *
     * @param request
     * @return
     */
    JsonData delShortLink(ShortLinkDelRequest request);

    /**
     * 生产者：更新短链
     *
     * @param request
     * @return
     */
    JsonData updateShortLink(ShortLinkUpdateRequest request);

    /**
     * 处理更新短链消息
     * @param eventMessage
     * @return
     */
    boolean handlerUpdateShortLink(EventMessage eventMessage);

    /**
     * 处理删除短链消息
     * @param eventMessage
     * @return
     */
    boolean handlerDelShortLink(EventMessage eventMessage);

}
